<?php
echo validation_errors();
$form = array(
    'id'    => 'form-category',
    'class' => 'ut-form'
);
foreach($cats as $idx=>$c)
{
    $options[$idx] = $c['name'];
    $subs = count($c['subs']);
    if($subs>0)
        foreach($c['subs'] as $sid=>$s)
            $options[$sid] = $c['name'].' >> '.$s['name'];
}
echo form_open('news/insert_category',$form);
echo form_fieldset();
echo '<ul>';
echo '<li>'.form_label('Kategoria nadrzędna:','parent').form_dropdown('parent',$options,set_value('parent',0)).'</li>';
echo '<li>'.form_label('Nazwa:','name').form_input(array('name'=>'name','placeholder'=>'Nazwa kategorii','class'=>'large'),set_value('name')).'</li>';
echo '</ul>';
echo form_fieldset_close();
echo '<p class="clear">'.form_submit('add_category','Dodaj kategorię','class="btn-primary btn-large"').'</p>';
echo form_close();
?>